home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks97 / WarriorsProgress.sit / Warrior’s Progress / source code / Source / Libraries / Events / Event Classes / User Events / Keyboard Events / KeystrokeEvent.cp < prev    next >
Text File  |  1997-06-28  |  605b  |  37 lines

  1. // KeystrokeEvent.cp
  2.  
  3. #ifndef KeystrokeEvent_h
  4. #include "KeystrokeEvent.h"
  5. #endif
  6. #ifndef Application_h
  7. #include "Application.h"
  8. #endif
  9. #ifndef KeyMessage_h
  10. #include "KeyMessage.h"
  11. #endif
  12. #ifndef UserCancelledError_h
  13. #include "UserCancelledError.h"
  14. #endif
  15. #ifndef UserState_h
  16. #include "UserState.h"
  17. #endif
  18.  
  19. KeystrokeEvent::KeystrokeEvent( const EventRecord& event )
  20.   : KeyEvent( event ),
  21.      message( Application::The().MakeKeyMessage( *this ) )
  22.   {
  23.   }
  24.  
  25. void KeystrokeEvent::Respond() const
  26.   {
  27.     try
  28.       {
  29.         message.Send();
  30.       }
  31.      catch ( UserCancelledError )
  32.       {
  33.       }
  34.     
  35.     UserState::The().Announce();
  36.   }
  37.